
	import java.sql.*;
	
public class MyCon {
	
	    private static Connection con=null;
	    public static Connection getCon(){
	          try{
	        if(con==null||con.isClosed()){
	            System.out.println("inside mycon");
	        Class.forName("com.mysql.jdbc.Driver");
	        con=DriverManager.getConnection("jdbc:mysql://localhost:3306/j2ee","root","");
	            }
	         }catch(Exception e){e.printStackTrace();}
	       
	        return con;
	    }
	    
	}



